
# list  列表的所有方法 案例
# list1 = ['ass','baidu','taobao','1999','1888','1222']
# list2 = [1,2,3,4,5,6,7,8]
# print(list1)
# print(list2)

# len
# print(len(list2))
# print(len(list1))
# list3 = list(range(5))
# print((list3))
# print(len(list3))

# max()

# list1,list2 = ['taobao','baidu','jingdong','meituan'],[100,200,300]
# print(max(list1))
# print(max(list2))
# print(min(list1))
# print(min(list2))

# list
# aTuple = (123,'baidu','taobao','jingdong')
# list1 = list(aTuple)
# print(list1)
#
# str = "Hello World"
# list2 = list(str)
# print(list2)

# append
# list1 = ['baidu','taobao','meituan']
# list1.append('jingdong')
# print(list1)

#count
# list2 = [123,'baidu','taobao','jingdong','taobao']
# print(list2.count('taobao'))

# extend
# list1 = ['baidu','w3c','taobao']
# list2 = list(range(5))
# list3 = [1,2,3,4,5,6,7]
# list1.extend(list2)
# list1.extend(list3)
# print(list1)
# print(list1)

# index()
# list1 = ['Google', 'W3CSchool', 'Taobao']
# print ('W3CSchool 索引值为', list1.index('W3CSchool'))
# print ('Taobao 索引值为', list1.index('Taobao'))

# insert()
# list1 = ['baidu','w3c','taobao']
# list1.insert(0,'baidu1')
# print(list1)

# pop()
# list = ['baidu','taobao','jingdong',123]
# list.pop()
# print(list)
# list.pop(1)
# print(list)

# remove()
# list1 = ['Google', 'W3CSchool', 'Taobao', 'Baidu']
# list1.remove('Taobao')
# print ("列表现在为 : ", list1)
# list1.remove('Baidu')
# print ("列表现在为 : ", list1)

# reverse()
# list1 = ['Google', 'W3CSchool', 'Taobao', 'Baidu']
# list1.reverse()
# print ("列表反转后: ", list1)

# sort()
# list1 = ['Google', 'W3CSchool', 'Taobao', 'Baidu']
# list = [1,7,3,6,5,2,0]
# list1.sort()
# list.sort()
# print ("列表排序后 : ", list1)
# print(list)

# clear()
# list1 = ['Google', 'W3CSchool', 'Taobao', 'Baidu']
# list1.clear()
# print ("列表清空后 : ", list1)

# copy()
# list1 = [1,2,3,4,5,6]
# list = list1.copy()
# print(list)

# 元组tuple
tup1 = ('Google', 'W3CSchool', 1997, 2020)
tup2 = (1, 2, 3, 4, 5 )
tup3 = "a", "b", "c", "d" # 不需括号也可以
# len()

# max()

# min()

# tuple

# operator


# 字典
# len()
# dict = {'Name': 'Zara', 'Age': 7}
# print (len(dict))
# dict.clear()
# print (len(dict))


# copy()
# dict1 = {'Name': 'W3CSchool', 'Age': 7, 'Class': 'First'}
# dict2 = dict1.copy()
# print (dict2)

# fromkeys
# seq = ('name','age','sex')
# dict = dict.fromkeys(seq)
# print(dict)
# dict = dict.fromkeys(seq,10)
# print(dict)
# print(str(dict))

# get()
# dict = {'Name': 'W3CSchool', 'Age': 27}
#
# print (dict.get('Age'))
# print (dict.get('Sex', "NA"))

# items()


# keys()

# setdefault()

# values

# 集合
# add()

# clear()

# copy()

# difference

# defference_update()

#

